@extends('admin.container')

@section('c-head')
    <script type="text/javascript">
        var PAGE_DATA = {
            REST_API: {
                backUrl : "{{ route('admin.provider.index') }}"
            },
            paperData : $.parseJSON('{!! \App\Http\Controllers\Admin\Member\Provider\ProviderController::fileInfo($member->id) !!}'), // 证件资料
            certification : [
                {
                    id: "1", // 实名认证,
                    txt: "实名认证",
                    chk : "{{ $member->store->real_name_authentication }}"
                },
                {
                    id: "2", // 供应商认证,
                    txt: "供应商认证",
                    chk : "{{ $member->store->provider_authentication }}"
                },

            ],
            storeState :　"{{ $member->store->audit_status }}", // 开启:1, 关闭:0;
            storeLevel : [
                {code: "1", text: "普通"},
                {code: "2", text: "白金"},
                {code: "3", text: "钻石"},
            ],
            storeLevelActive : "{{ $member->store->level }}",
        };
    </script>
@stop

@section('c-body')
    <div class="comm-title">
        <span class="title-msg">会员 > 供应商 > 列表 > 查看/编辑</span>
    </div>
    <div class="comm-body">
        <form id="main-form" style="margin-top: 20px;" method="POST" action="{{ route('admin.provider.update', [$member->id]) }}">
            {{ csrf_field() }}
            <input name="_method" value="PUT" hidden="hidden">
            <div class="clearfix">
                <div class="form-left fl tr">
                    用户名：
                </div>
                <div class="form-right fl">
                    {{ $member->user }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    登录密码：
                </div>
                <div class="form-right fl">
                    <input name="pw" type="password" style="float:left;" />
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    电子邮箱：
                </div>
                <div class="form-right fl">
                    {{ $member->email }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    公司全称：
                </div>
                <div class="form-right fl">
                    {{ $member->information->company }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    公司法人：
                </div>
                <div class="form-right fl">
                    {{ $member->information->legal }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    法人身份证：
                </div>
                <div class="form-right fl">
                    {{ $member->information->identification_number }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    所在地：
                </div>
                <div class="form-right fl">
                    {{ \App\B2BProject\Area::getName($member->information->province_id) . ' ' . \App\B2BProject\Area::getName($member->information->city_id) . \App\B2BProject\Area::getName($member->information->county_id) }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    公司地址：
                </div>
                <div class="form-right fl">
                    {{ $member->information->address }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    联系人姓名：
                </div>
                <div class="form-right fl">
                    {{ $member->information->contact_person }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    联系人电话：
                </div>
                <div class="form-right fl">
                    {{ $member->information->contact_phone }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    主营类别：
                </div>
                <div class="form-right fl">
                    {{ implode(", ", $member->store->mainCategory()->lists('name')->toArray()) }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    主营品牌：
                </div>
                <div class="form-right fl">
                    {{ implode(", ", $member->store->mainBrand()->lists('name')->toArray()) }}
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    证件资料：
                </div>
                <div id="paper-box" class="form-right fl" style="height: auto">
                    <div class="clearfix">
                        <div class="fl" style="width: 100px;height: auto;">
                            <img src="">
                            <span class="wbb tc db c-gray lh50">营业执照</span>
                        </div>


                    </div>
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    认证:
                </div>
                <div class="form-right fl" id="certification">
                    <div class="fl ml25">
                        <input type="checkbox" style="width: auto;height: auto;"
                               name="real_name_authentication" id="real_name_authentication">
                        <label for="real_name_authentication">
                            <img src="/assets/b2b/admin/css/images/name_a.png" style="width: 28px;height: 28px;margin-left: 5px"> 实名认证
                        </label>
                    </div>
                    <div class="fl ml25">
                        <input type="checkbox" style="width: auto;height: auto;"
                               name="provider_authentication" id="provider_authentication">
                        <label for="provider_authentication">
                            <img src="/assets/b2b/admin/css/images/supply_a.png" style="width: 28px;height: 28px;margin-left: 5px">供应商认证
                        </label>
                    </div>
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    店铺状态：
                </div>
                <div class="form-right fl">
                    <div id="sel-recommed" class="am-btn-group">
                        <button type="button" class="am-btn am-btn-sm " data-sts="1">
                                    <span style="display:block;">
                                        开启
                                    </span>
                        </button>
                        <button type="button" class="am-btn am-btn-sm " data-sts="0">
                                    <span style="display:block;">
                                        关闭
                                    </span>
                        </button>
                    </div>
                    <input type="hidden" id="status" name="status" />
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                    店铺等级：
                </div>
                <div class="form-right fl">
                    <select id="store_level" name="store_level" style="width: 200px;height: 32px;">
                    </select>
                </div>
            </div>
            <div class="clearfix mt10">
                <div class="form-left fl tr">
                </div>
                <div class="form-right fl">
                    <input type="submit" value="保存" class="am-btn am-btn-secondary" style="width: auto;height: auto">
                    <a id="back-btn" class="am-btn am-btn-default">返回</a>
                </div>
            </div>
        </form>
    </div>

    <script type="text/template" id="paper_templ">
        <%_.each(obj, function(item){%>
        <div class="data-picture">
            <div class="picture">
                <a target="_blank" class="todooflyout" href="<%=item.img%>"><img src="<%=item.img%>"></a>
            </div>
            <span style="position:relative;"><%=item.text%></span>
        </div>
        <%})%>
    </script>


    <script src="/assets/b2b/admin/js/libs/jquery.validate.min.js"> </script>
    <script src="/assets/b2b/admin/js/libs/messages_zh.js"> </script>

    <script src="/assets/b2b/admin/js/pages/12.js"></script>
@stop